import java.util.concurrent.Callable;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.FutureTask;

public class TestDemo {
    public static void main(String[] args) {
        ExecutorService executorService = Executors.newFixedThreadPool(5);
        executorService.submit(new Runnable() {
            @Override
            public void run() {
                System.out.println("5");
            }
        });

    }
    public static void main4(String[] args) {
        Callable<Integer> callable = new Callable<Integer>() {
            @Override
            public Integer call() throws Exception {
                return  4;
            }
        };
        FutureTask<Integer> futureTask = new FutureTask<>(callable);
        Thread t = new Thread(futureTask);
        t.start();
    }
    public static void main3(String[] args) {
        Thread t = new Thread(()-> {
            System.out.println("3");
        });

        t.start();
    }
    public static void main2(String[] args) {
        Thread t = new Thread(new Runnable() {
            @Override
            public void run() {
                System.out.println("2");
            }
        });

        t.start();
    }

    public static void main1(String[] args) {
        Thread t = new Thread() {
            @Override
            public void run() {
                System.out.println("1");
            }
        };

        t.start();
    }
}
